package netnotifier.notification;

import java.util.Arrays;
import java.util.List;


public class TCPSegment extends NetNotification
{
	public String clientIP="";
	public String serverIP="";
	public String type;
	
	public int length=-1;
	
	public byte[] data=new byte[0];
	
	public static String[] defaultFields=new String[]{"clientIP","serverIP","type","length"};
	
	public TCPSegment()
	{
		length=0;
	}
	
	public void append(byte[] newData)
	{
		length+=newData.length;
	
		byte[] temp=new byte[data.length+newData.length];

		// TODO there has to be a nicer way to do this..
		for(int x=0;x<data.length;++x)
		{
			temp[x]=data[x];
		}
		for(int x=0;x<newData.length;++x)
		{
			temp[data.length+x]=newData[x];
		}
		
		data=temp;
	}
}
